package top.huhuiyu.ds;

/**
 * 泛型类type T是类型定义占位符，在创建类的时候指定
 * 
 * @author Aiden Pearce
 *
 * @param <T>
 */
public class MyNode<T> {
  /**
   * 泛型类通过T确定类型，data是节点数据
   */
  private T data;
  private MyNode<T> next;

  public MyNode() {
  }

  public MyNode(T data) {
    this.data = data;
  }

  public T getData() {
    return data;
  }

  public void setData(T data) {
    this.data = data;
  }

  public MyNode<T> getNext() {
    return next;
  }

  public void setNext(MyNode<T> next) {
    this.next = next;
  }

  @Override
  public String toString() {
    return "MyNode [data=" + data + "]";
  }

}
